//
//  WYYXLiveViewFactory.swift
//  liveplugin
//
//  Created by yunxiwangluo on 2020/4/22.
//

import UIKit

class WYYXLiveViewFactory: NSObject,FlutterPlatformViewFactory {
    
    var registrar: FlutterPluginRegistrar?
    
    public init(withRegistrar registrar: FlutterPluginRegistrar){
        super.init()
        self.registrar = registrar
    }
    
    
    func create(withFrame frame: CGRect, viewIdentifier viewId: Int64, arguments args: Any?) -> FlutterPlatformView {
        
        //var dictionary = args as? Dictionary<String,Double>
        
        return WYYXLiveView(withFrame: UIScreen.main.bounds, withRegistrar: registrar!, withId: viewId)
        
    }
    
    public func createArgsCodec() -> FlutterMessageCodec & NSObjectProtocol {
        return FlutterStandardMessageCodec(readerWriter: FlutterStandardReaderWriter())
    }
    

}
